<ion-header class="card-background-page">
  <div class="g-top">
      <div class="m-logo">贵州茂兰国家级自然保护区电子办公系统</div>
  </div>
  <div class="zs-header" style="z-index: 1000;">
    <ion-segment [(ngModel)]="pet">
      <!-- <ion-segment-button (click)="setMajor('-');" disabled="{{!less}}">
        <ion-icon name="md-arrow-dropleft"></ion-icon>
      </ion-segment-button> -->

      <ion-segment-button value="指派给我的" (click)="setTable('gztaskview')">
        指派给我的
      </ion-segment-button>
      <ion-segment-button value="我发布的" (click)="setTable('schedule')">
        我发布的
      </ion-segment-button>
      <ion-segment-button value="出差管理" (click)="setTable('gzccgl')">
        出差管理
      </ion-segment-button>
    </ion-segment>
    <!--<ion-input class="zs-search" [(ngModel)]="queryValue"
                type="search" placeholder="   查询"
                [ngModelOptions]="{standalone: true}"
                (keyup)="onSearchKeyUp($event)"></ion-input>-->
  </div>
</ion-header>
<ion-content class="card-background-page">

  <!--指派给我的-->
  <div style="margin-top: 80px;" *ngIf="tableName=='gztaskview'">
    <ion-refresher (ionRefresh)="gztaskview.doRefresh($event,editDatas)">
      <ion-refresher-content pullingIcon="arrow-dropdown"  pullingText="下拉刷新"  refreshingSpinner="circles"  refreshingText="刷新中...">
        </ion-refresher-content>
    </ion-refresher>

    <ion-list *ngFor="let item of gztaskview.datas" style="padding-left: 1px;right: -7px;width: calc(100% - 15px);margin-top:10px; ">
      <button ion-item detail-none class="buttonscss" (click)="toggleDetails(item)">
        <ion-icon item-left color="#444" name="{{item.icon}}"></ion-icon>
        <h3>{{item.xmmc}}({{item.ztName}})</h3>
        <p item-right>{{item.cjsj | date:'yyyy-MM-dd'}}</p>
      </button>
      <div *ngIf="item.showDetails" class="divcard" padding #divcard>
        <ion-row>
            <p><span>主题：</span>{{item.zhuti}}</p>
        </ion-row>
        <ion-row>
          <p><span>备注：</span>{{item.sxsm}}</p>
        </ion-row>
        <ion-row>
            <p><span>开始时间：</span>{{item.kssj | date:'yyyy-MM-dd'}}</p>
        </ion-row>
        <ion-row>
            <p><span>结束时间：</span>{{item.jssj | date:'yyyy-MM-dd'}}</p>
        </ion-row>
        <ion-row>
          <ion-col>
            <button ion-button icon-only clear full large (click)="toQueryTask(item)">
              <ion-icon name="md-search"></ion-icon>
              查看详情
            </button>
          </ion-col>
        </ion-row>
      </div>
    </ion-list>

    <!-- 无级滚动效果实现 -->
    <ion-infinite-scroll (ionInfinite)="gztaskview.doInfinite($event,editDatas)">
      <ion-infinite-scroll-content></ion-infinite-scroll-content>
    </ion-infinite-scroll>
  </div>

  <!--我发布的-->
  <div style="margin-top: 80px;" *ngIf="tableName=='schedule'">
    <ion-refresher (ionRefresh)="schedule.doRefresh($event,scheduleEditDatas)">
      <ion-refresher-content pullingIcon="arrow-dropdown"  pullingText="下拉刷新"  refreshingSpinner="circles"  refreshingText="刷新中...">
        </ion-refresher-content>
    </ion-refresher>

    <div style="float:right;margin-right:14px;">
        <button ion-button (click)='addScheduleRow()'>
            发布任务
        </button>
    </div>

    <ion-list *ngFor="let item of schedule.datas" style="padding-left: 1px;right: -7px;width: calc(100% - 15px);margin-top:10px; ">
        <button ion-item detail-none class="buttonscss" (click)="toggleDetails(item)">
          <ion-icon item-left color="#444" name="{{item.icon}}"></ion-icon>
          <h3>{{item.xmmc}}({{item.ztName}})</h3>
          <p item-right>{{item.cjsj | date:'yyyy-MM-dd'}}</p>
        </button>
        <div *ngIf="item.showDetails" class="divcard" padding #divcard>
          <ion-row>
              <p><span>主题：</span>{{item.zhuti}}</p>
          </ion-row>
          <ion-row>
              <p><span>备注：</span>{{item.sxsm}}</p>
          </ion-row>
          <ion-row>
              <p><span>参与人：</span>{{item.cyr}}</p>
          </ion-row>
          <ion-row>
              <p><span>创建人：</span>{{item.cjrmc}}</p>
          </ion-row>
          <ion-row>
              <p><span>部门：</span>{{item.bmmcName}}</p>
          </ion-row>
          <ion-row>
            <ion-col>
              <button ion-button icon-only clear full large (click)="toQuerySchedule(item)">
                <ion-icon name="md-search"></ion-icon>
                查看详情
              </button>
            </ion-col>
          </ion-row>
        </div>
      </ion-list>
    <!-- 无级滚动效果实现 -->
    <ion-infinite-scroll (ionInfinite)="schedule.doInfinite($event,scheduleEditDatas)">
      <ion-infinite-scroll-content></ion-infinite-scroll-content>
    </ion-infinite-scroll>
  </div>

  <!--我发布的-->
  <div style="margin-top: 80px;" *ngIf="tableName=='gzccgl'">
    <ion-refresher (ionRefresh)="gzccgl.doRefresh($event,editDatas)">
      <ion-refresher-content pullingIcon="arrow-dropdown"  pullingText="下拉刷新"  refreshingSpinner="circles"  refreshingText="刷新中...">
      </ion-refresher-content>
    </ion-refresher>

    <ion-list *ngFor="let item of gzccgl.datas" style="padding-left: 1px;right: -7px;width: calc(100% - 15px);margin-top:10px; ">
      <button ion-item detail-none class="buttonscss" (click)="toggleDetails(item)">
      <ion-icon item-left color="#444" name="{{item.icon}}"></ion-icon>
      <h3>{{item.wcsy}}</h3>
      <p item-right>{{item.sqrq | date:'yyyy-MM-dd'}}</p>
      </button>
      <div *ngIf="item.showDetails" class="divcard" padding #divcard>
      <ion-row>
        <p><span>申请人：</span>{{item.ccrxm}}</p>
      </ion-row>
      <ion-row>
        <p><span>开始时间：</span>{{item.kssj | date:'yyyy-MM-dd'}}</p>
      </ion-row>
      <ion-row>
        <p><span>结束时间：</span>{{item.jssj | date:'yyyy-MM-dd'}}</p>
      </ion-row>
      <ion-row>
        <ion-col>
        <button ion-button icon-only clear full large (click)="toQueryWork(item)">
          <ion-icon name="md-search"></ion-icon>
          查看详情
        </button>
        </ion-col>
      </ion-row>
      </div>
    </ion-list>
    
    <!-- 无级滚动效果实现 -->
    <ion-infinite-scroll (ionInfinite)="gzccgl.doInfinite($event,editDatas)">
      <ion-infinite-scroll-content></ion-infinite-scroll-content>
    </ion-infinite-scroll>
  </div>

</ion-content>
